﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ExportToRTR.CApExportToRTRRailsExporter
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections.Generic;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.ExportToRTR{

internal class CApExportToRTRRailsExporter : CApExportToRTRCollectionExporter<ITxDevice>
{
  private Dictionary<ITxDevice, List<TxRobot>> m_rails = new Dictionary<ITxDevice, List<TxRobot>>();

  public void Add(ITxDevice rail, TxRobot robot)
  {
    if (!this.m_rails.ContainsKey(rail))
      this.m_rails.Add(rail, new List<TxRobot>());
    this.m_rails[rail].Add(robot);
  }

  public override void Export(CApExportToRTRXmlWriter writer, string path, string worldLink)
  {
    foreach (KeyValuePair<ITxDevice, List<TxRobot>> rail in this.m_rails)
    {
      CApExportToRTRStaticRail exportToRtrStaticRail = new CApExportToRTRStaticRail(rail.Key, rail.Value, path);
      exportToRtrStaticRail.Export();
      this.Exported3D.UnionWith((IEnumerable<ITxObject>) exportToRtrStaticRail.Static3D);
    }
  }
}
